package com.sgb.kjwl.view.ui.adapter.self;

import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.self.MotorcadeSimpleEntity;

import java.util.List;

/**
 * Describe:    选择车队列表Adapter
 * Author:  yangLei
 * Date:    2021/10/12
 */
public class ChooseMotorcadeAdapter extends BaseQuickAdapter<MotorcadeSimpleEntity, BaseViewHolder> {
    public ChooseMotorcadeAdapter(@Nullable List<MotorcadeSimpleEntity> data) {
        super(R.layout.app_choose_motorcade_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MotorcadeSimpleEntity item) {
        helper.setText(R.id.name, !TextUtils.isEmpty(item.getMotorcadeName()) ? item.getMotorcadeName() : "")
                .setImageResource(R.id.select_iv, item.isSelect() ? R.mipmap.img_select : R.mipmap.img_unselect);

        helper.addOnClickListener(R.id.item_layout);
    }
}
